package lvyou;

public class VisitorS extends Visitor {
    private boolean dex; //是否占座

    public VisitorS() {
    }

    public VisitorS(int age, String name, double prise,boolean dex) {
        super(age, name, prise);
        this.dex = dex;
    }

    public boolean getDex() {
        return dex;
    }

    public void setDex(boolean dex) {
        this.dex = dex;
    }

    @Override
    public double money(double prise) {
        if(prise==30){
            return 30;
        }
        return 0;
    }

    public void show(){
        System.out.println("姓名:" + this.getName() + ",年龄:" + this.getAge() + ",是否占床:"+this.getDex()+",本次行程" + this.getPrise() + "元");
    }
}
